﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HouseManager.DAL;
using HouseManger.Model;

namespace HouseManager.BLL
{
    public class MangerBLL
    {
        MangerDAL mangerDAL = new MangerDAL();
        /// <summary>
        /// 列表显示
        /// </summary>
        /// <returns></returns>
        public List<HouseList> GetList()
        {
            return mangerDAL.GetList(); 
        }
        /// <summary>
        /// 查询小区名称
        /// </summary>
        /// <param name="Name"></param>
        /// <returns></returns>
        public List<HouseList> GetListName(string Name)
        { 
            return mangerDAL.GetListName(Name); 
        }
        /// <summary>
        /// 获取房屋类型
        /// </summary>
        /// <returns></returns>
        public List<HouseType> GetHouseType()
        { 
           return mangerDAL.GetHouseType(); 
        }
        /// <summary>
        /// 添加信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int Add(HouseInfo info)
        { 
           return mangerDAL.Add(info);  
        }
        /// <summary>
        /// 修改上下架
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool UpdateState(int id)
        { 
           return mangerDAL.UpdateState(id);
        }
        /// <summary>
        /// 查询要编辑的数据Id
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public HouseInfo SelectId(int id)
        { 
           return mangerDAL.SelectId(id);   
        }
        /// <summary>
        /// 修改信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int EditInfo(HouseInfo info)
        { 
           return mangerDAL.EditInfo(info); 
        }

        /// <summary>
        /// 删除信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DeleteInfo(int id)
        { 
          return mangerDAL.DeleteInfo(id);
        }
    }
}
